import * as request from '@/utils/request/request'
const prefix= ''
const api = {
    /**
     * 街道防范宣传处置导出
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    streetWarnExport(date){
        request.getBlob(`${prefix}/list/exportStreetWarnData?startDate=${date[0]}&endDate=${date[1]}`)
        // return request.get(`${prefix}/list/exportWarnData?startDate=${date[0]}&endDate=${date[1]}`)
        // window.open()
    },

    /**
     * 获取黑样本统计
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    getSampleCountList(params){
        return request.post(`${prefix}/list/sampleCountList`, params)
    },
    /**
     * 预警量曲线图
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    getWarnNum(params){
        return request.get(`${prefix}/index/warn_num`,params)
    },
    /**
     * 接报类型分类
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    getCaseType(params){
        return request.post(`${prefix}/index/case_type?type=${params.type}`, params)
    },
    /**
     * 被害人导出
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    exportVinctimAnalysis(date){
        request.getBlob(`${prefix}/vip/exportVinctimAnalysis?startDate=${date[0]}&endDate=${date[1]}`)
        // return request.get(`${prefix}/list/exportWarnData?startDate=${date[0]}&endDate=${date[1]}`)
        // window.open()
    },
    /**
     * 重点预警人员导出
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    exportVipWarnList(date){
        request.getBlob(`${prefix}/vip/exportVipWarnList?startDate=${date[0]}&endDate=${date[1]}`)
        // return request.get(`${prefix}/list/exportWarnData?startDate=${date[0]}&endDate=${date[1]}`)
        // window.open()
    },
    /**
     * 导出精准防范处置
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    exportPreciseWarnData(date){
        request.getBlob(`${prefix}/list/exportPreciseWarnData?startDate=${date[0]}&endDate=${date[1]}`)
    },
    /**
     * 删除精准防范处置
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    delete_precise_warn_list(date){
        request.post(`${prefix}/list/delete_precise_warn_list?startDate=${date[0]}&endDate=${date[1]}`, {
            startDate: date[0],
            endDate: date[1],
        })
    },
    /**
     * 预警删除
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    delete_warn_list(date){
        request.post(`${prefix}/list/delete_warn_list?startDate=${date[0]}&endDate=${date[1]}`, {
            startDate: date[0],
            endDate: date[1],
        })
    },
    /**
     * 预警导出
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    dataManageExport(date){
        request.getBlob(`${prefix}/list/exportWarnData?startDate=${date[0]}&endDate=${date[1]}`)
        // return request.get(`${prefix}/list/exportWarnData?startDate=${date[0]}&endDate=${date[1]}`)
        // window.open()
    },

    /**
     * 大屏数据接口
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    index_countNum(){
        return request.get(`${prefix}/index/countNum`)
    },

    /**
     * 大屏数据接口
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    active_fraud_type(params){
        return request.post(`${prefix}/index/active/fraud_type`,params)
    },
    active_street_type(params){
        return request.post(`${prefix}/index/active/street_type`,params)
    },
    active_type_pie(params){
        return request.post(`${prefix}/index/active/type_pie`,params)
    },
    indexType_pie(params){
        return request.post(`${prefix}/index/type_pie`,params)
    },

    VIP_num(params){
        return request.post(`${prefix}/index/VIP_num`,params)
    },
    add_white(params){
        return request.post(`${prefix}/vip/add_white`,params)
    },
    vip_handle(params){
        return request.post(`${prefix}/vip/handle`,params)
    },

    getEighthours_rate(params){
        return request.post(`${prefix}/index/eighthours_rate`,params)
    },
    getafter_rate(params){
        return request.post(`${prefix}/index/after_rate`,params)
    },
    getcase_num(params){
        return request.post(`${prefix}/index/case_num`,params)
    },
    station_rank(params){
        return request.post(`${prefix}/index/station_rank?type=${params.type}`,params)
    },
    character_portraits(params){
        return request.post(`${prefix}/index/character_portraits`,params)
    },

    warn_person(params){
        return request.post(`${prefix}/index/warn_person`,params)
    },
    case_list(params){
        return request.post(`${prefix}/index/case_list`,params)
    },

    getWarnList(params){
        return request.post(`${prefix}/list/warn_list`,params)
    },
    /**
     * 导出top20数据接口
     * @param params
     * @returns {Promise<AxiosResponse<any>>}
     */
    indexHomeExport(params){
        return request.post(`${prefix}/index/home/export?type=${params.type}`, {}, {responseType: 'blob'})
    },
    getTable: (url,params) => request.post(url, params),
    // post
    post: (url, params) => request.post(url, params),
    // get
    get: (url, params) => request.get(url, params),

}
export default api
